<?php
/*
+ --------------------------------------------------- +
|  Ineo Article Manager - Version 1.x
|  Copyright © 2005-2008, Dan Cryer and William McGann
+ --------------------------------------------------- +

Ineo Article Manager is free software; you can redistribute it and/or modify
it under the terms of version 3 of the GNU General Public License as published by
the Free Software Foundation.

Ineo Article Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ineo; see the file License.txt.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

*/

require_once('./sources/installer.php');
$install = new installer();

if( !$install->authorize() )
{
	print 'Sorry, you do not have permission to run the installer.';
	die;
}

if( $install->is_installed() )
{
	$install->type = ( empty( $install->ipsclass->input['install'] ) ) ? 'upgrade' : 'install';
}
else
{
	$install->type = 'install';
}

$install->data_dir = './data-'.$install->type.'/';
$install->step_dir = './sources/steps-'.$install->type.'/';

if( empty($install->ipsclass->input['step']) )
{
	$install->step = 1;
}
else
{
	$install->step = intval( $install->ipsclass->input['step'] );
}

$install->run();

?>